// =============================================================
// CInterpreter
// ---------------------------------------
// Author : Woo-Hyun Kim
// Email : woorung@icu.ac.kr or woorung@nhncorp.com
// Date : Aug. 8, 2006
// =============================================================
#ifndef CInterpreterH
#define CInterpreterH
//-----------------------------------------------------------------
#include <iostream>
#include <iterator>
#include <vector>
#include <list>
#include <map>
#include <algorithm>
#include <fstream>
#include <string>

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/stat.h>
#include <dirent.h>

#include "CProcess.h"

using namespace std;
//-----------------------------------------------------------------
class CInterpreter : public CProcess {
protected :
	string call_name;
	map<string,string> params;
	map<string,string> returns;

	int read_upstream(const void *buf, size_t size);
	int read_downstream(const void *buf, size_t size);
	void before_run();

public :
	CInterpreter(string &name);
	~CInterpreter();

	void invoke(map<string,string> &action_variables);
	void invoke(map<string,string> &common_task_variables, map<string,string> &task_variables, map<string,string> &action_variables);

	void run();
};
//----------------------------------------------------------------
#endif
